<template>
	<view>
		<view class="myinfocard">
			<u-row class="myinfocardcontent">
				<u-col span="3">
					<u-avatar mode="square" size="120" :src="userinfo.avatarUrl" class="avatarbox"></u-avatar>
				</u-col>
				<u-col span="8">
					<view class="firstlinetext">{{userinfo.nickName}}</view>
					<view>{{gender}}&nbsp;{{userinfo.city}}&nbsp;{{userinfo.province}}&nbsp;{{userinfo.country}}</view>
				</u-col>
			</u-row>
		</view>
		<view class="setcontent">
			<u-cell-group>
				<u-cell-item icon="integral-fill" title="医师信息" @click="toPath"></u-cell-item>
				<u-cell-item icon="setting-fill" title="个人设置"></u-cell-item>
				<u-cell-item icon="question-circle-fill" title="关于我们" @click="test"></u-cell-item>
				<u-cell-item icon="man-add-fill" title="上传头像"></u-cell-item>
			</u-cell-group>
		</view>
		<view class="exitbutton second-font" @click="exit">
			退出
		</view>
		<u-tabbar :list="tabbar" active-color="#2979ff" inactive-color="#b9b9b9"></u-tabbar>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				tabbar:'',
				userinfo:[],
				gender:'',
			}
		},
		methods:{
			exit(){
				uni.showModal({
					title: '提示',
					content: '是否退出？',
					success: function (res) {
					    if (res.confirm) {
							getApp().globalData.userinfo={},
							getApp().globalData.doctorinfo={},
							uni.navigateTo({
								url:"../doctor_loginpage"
							})
						}
					},
				})
			},
			toPath(){
				uni.navigateTo({
					url:"doctor_infopage"
				})
			},
			test(){
				uni.showModal({
					    title: '提示',
					    content: '31801085朱政旭 31801066沈文燕 31801061王灵霜',
					    success: function (res) {
					        if (res.confirm) {
					            console.log('用户点击确定');
					        } else if (res.cancel) {
					            console.log('用户点击取消');
					        }
					    }
					});
			}
		},
		onLoad(){
			this.userinfo=getApp().globalData.userinfo
			if(this.userinfo.gender==1)
				this.gender='男'
			else
				this.gender='女'
			this.tabbar=
			[
				{
					iconPath: "home",
					selectedIconPath: "home-fill",
					text: '首页',
					pagePath:"/pages/doctor_mainpage"
				},
				{
					iconPath: "grid",
					selectedIconPath: "grid-fill",
					text: '配药',
					pagePath:"/pages/dispensing/doctor_dispensing" 
				},
				// {
				// 	iconPath: "file-text",
				// 	selectedIconPath: "file-text-fill",
				// 	text: '处方',
				// 	pagePath:"/pages/prescription/doctor_prescriptionlist"
				// },
				{
					iconPath: "account",
					selectedIconPath: "account-fill",
					text: '我的',
					pagePath:"/pages/mine/doctor_mypage"
				},
			]
		}
	}
</script>

<style scopped>
	page{
		background-color: #f5f5f5;
	}
	.myinfocard{
		width: 100%;
		height: 220rpx;
		background-color: #1477fe;
		color: #FFFFFF;
	}
/* 	.u-row{
		margin-left: 30rpx;
	} */
	.myinfocardcontent{
		padding: 100rpx;
	}
	.firstlinetext{
		font-size: 40rpx;
		padding-bottom: 20rpx;
	}		
	.avatarbox{
		margin-left: 30rpx;
	}
	.setcontent{
		margin-top: 20rpx;
	}
	.exitbutton{
		margin-top: 50rpx;
		background-color: #FFFFFF;
		width: 100%;
		text-align: center;
		font-size: 32rpx;
		padding: 32rpx;
		border: 1rpx solid #e4e4e4;
	}
</style>
